
<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>


<html>
  <head>
    <base href="<%=basePath%>">
    
    <title>My JSP 'topp.jsp' starting page</title>
    
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">    
	<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
	<meta http-equiv="description" content="This is my page">
	<!--
	<link rel="stylesheet" type="text/css" href="styles.css">
	-->
	<script type="text/javascript">

		//检查手机号码
		function checkMobile( s ){   
			var regu =/^[1][3458][0-9]{9}$/; 
			var re = new RegExp(regu); 
			if (re.test(s)) { 
				return true; 
			}else{ 
				return false; 
			} 
		} 


		//判断字符是否是中文字符
		function isChina(s){ 
			if(/.*[\u4e00-\u9fa5]+.*$/.test(s)) 
			{ 

			return true; 
			} 
			return false
		} 
		
		//验证是否为空
		function isNull( str ){ 
		if ( str == "" ) return true; 
		var regu = "^[ ]+$"; 
		var re = new RegExp(regu); 
		return re.test(str); 
		} 
		
		//验证是否为邮箱
		function isEmail( str ){  
		var emailReg = /^[\w-]+(\.[\w-]+)*@[\w-]+(\.[\w-]+)+$/; 
		if(emailReg.test(str)) return true; 
		return false; 
		} 

		//写验证
		function validate()
		{
			var flag =true;
			var username = document.getElementById("username");
		
			var password = document.getElementById("password");

			var password1 = document.getElementById("password1"); 

			var email = document.getElementById("email");

			var mobile= document.getElementById("phonenumber");


			if(!isChina(username.value)){
				document.getElementById("tip_usennme").style.display="";
				flag = false;
			}
			else{
				document.getElementById("tip_usennme").style.display="none";
			}

			if(username == null || isChina(username.value)){
				//return false;
			}
		
			//密码长度大于3
			if(password.value.length <3){
				document.getElementById("tip_pessword").style.display="";

				flag = false;
			}
			else{
				document.getElementById("tip_pessword").style.display="none";
			}
			//验证两次输入密码是否一致
			if(password.value != password1.value){
				document.getElementById("tip_pascword2").style.display="";
				flag = false;
			}
			else{
				document.getElementById("tip_pascword2").style.display="none";
			}

			if(!isEmail(email.value)){
				document.getElementById("tip_email").style.display="";
				flag = false;
			}
			else{
				document.getElementById("tip_email").style.display="none";
			}

			
			return false;	
			
		}
	</script>

  </head>
  
  <body background="IMG/BBS_ground_2.jpg" >
   <%@ include file="top.jsp" %>
  <table width="900" border="0" cellpadding="0" align="center" height="400">
  <form action="Register.do" method="post">
 <tr>
    <td>
    </td>
	<td></td>
    </tr>

  <tr>
    <td align= "center"> &nbsp;  *用户昵称：&nbsp; <input type="text" id="username" name="registername"></td>
    <td class="tipcol"><span id="tip_usennme" class="p_tip" style="display: none; ">请用中文注册,不能含有英文、数字</span>
    <span id="chk_usennme" class="p_chk" style="display: none; " >该用户名已注册，请更换用户名或
    <a href="member.php?mod=logging&amp;action=login" onclick="showWindow('login', this.href);return false;" class="xi2">登录</a></span></td>
    </tr>
  <tr>
    <td align="center"> &nbsp;  *用户密码：&nbsp; <input type="text" id="password" name="registerpassword"></td>
    <td class="tipcol"><span id="tip_pessword" class="p_tip" style="display:none;">请填写密码, 最小长度为 8 个字符</span></td>

  </tr>
  <tr>
    <td align="center"> &nbsp;*确认密码：&nbsp; <input type="text" id="password1" name="registerpassword2"></td>
    <td class="tipcol"><span id="tip_pascword2" class="p_tip" style="display:none; ">两次输入密码不一致</span></td>
 
  </tr>
  <tr>
    <td align="center"> &nbsp;*验证邮箱：&nbsp; <input type="text" id="email" value="@qq.com" name="email"></td>
	  <td class="tipcol"><span id="tip_email" class="p_tip" style="display:none; ">邮箱格式错误</span></td>
  </tr>
  <tr>
   <td align="center"> &nbsp;*手机号码：&nbsp; <input type="text" id="phonenumber" name="number"></td>
  </tr>
  <tr>
   <td align="center"> *情感状态：&nbsp; <select name="feel" ><option value="期待ing">期待ing</option>
   <option value="单身ing">单身ing</option><option value="热恋ing">热恋ing</option><option value="失恋ing">失恋ing</option>
   <option value="暗恋ing">暗恋ing</option><option value="有夫之妇">有夫之妇</option><option value="有妇之夫">有妇之夫</option>
   <option value="我是拉拉">我是拉拉</option><option value="我是玻璃">我是玻璃</option><option value="拒绝骚扰">拒绝骚扰</option></select>
   </td>
  </tr>
  <tr>
    <td align="center"> *所在学院：&nbsp; <select name="college"><option value="软件学院">软件学院</option>
   <option value="经济学院">经济学院</option><option value="管理学院">管理学院</option><option value="艺术学院">艺术学院</option>
   <option value="外文学院">外文学院</option><option value="国际学院">国际学院</option><option value="药学院">药学院</option>
   <option value="医学院">医学院</option><option value="化学化工学院">化学化工学院</option><option value="新闻传播学院">新闻传播学院</option>
   <option value="校外人士">校外人士</option><option value="我是新生">我是新生</option>></select>
  </tr>
  <tr>
   <td align="center"> *验证码：&nbsp; <input type="text" name="number"></td>
   </tr>
 <tr>
 <td align="center"> &nbsp;<input type="submit" value="提交" onclick="return validate() "><input type="reset" value="重置"></td>
 </tr>
   </form>
</table>
<%@ include file="last.jsp" %>

  </body>
</html>

